package com.marry.JMail;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * @author ml
 * @create 2017-06-20--17:03
 */
public class PropertiesUtil {

    private final ResourceBundle resource;
    private final String fileName;

    /**
     * 构造函数实例化部分对象，获取文件资源对象
     * @param fileName
     */
    public PropertiesUtil(String fileName){
        this.fileName=fileName;
        Locale locale=new Locale("zh","CN");
        this.resource=ResourceBundle.getBundle(this.fileName,locale);
    }


    public String getValue(String key){
        String message=this.resource.getString(key);
        return message;
    }


}
